<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>陈哲+20231107131+上机报告9</title>
    <script language="javascript">
        function checkUserName(){
            var fname=document.myform.txtUser.value;
            if(fname.length!=0){
                for(i=0;i<fname.length;i++){
                    var ftext=fname.substring(i,i+1);
                    if(ftext<9||ftext>0){
                        alert("名字包含数字\n"+"请删除名字中的数字和特殊字符");
                        return false;
                    }
                }
            }
            else {
            alert("未输入用户名，请输入用户名");
            return false;
        }
        return true;
        }
        function checkPassword()
        {
            var userpass=document.myform.txtpwd.value;
            if(userpass==" ")
            {
                alert("未输入密码\n"+"请输入密码");
                return false;
            }
            if(userpass.length<6)
            {
                alert("密码必须多于或等于6个字符。\n");
                return false;
            }
            return true;
        }
        function validateform()
        {
            if(checkUserName()&&checkPassword())
            return ture;
            else
            return false;
        }
    </script>
</head>
<body>
    <form action="#" name="myform" method="post" onSubmit="return validateform()">
        <p style="text-align: center;"><img src="images/reg_back1.jpg" style="width: 979px; height: 195px;"></p>
        <p>&nbsp;</p>
        <table style="border-width: 0; margin: 0 auto">
            <tr>
                <td>用户名:</td>
                <td colspan="2"><input type="text" name="txtUser" id="txtUser"/>*必填</td>
            </tr>
            <tr>
                <td>密&nbsp;码:</td>
                <td colspan="2"><input type="password" name="txtpwd" id="txtpwd"/>*必填</td>
            </tr>
            <tr>
                <td colspan="3" align="center">
                    <p></p>
                    <p><input type="reset" name="clearButton" id="clearButton" value="清空">
                        <input type="submit" name="regButton" id="clearButton" value="登录"></p>
                </td>
            </tr>
        </table>
        <p></p>    <p></p>   <p></p>
        <p style="text-align: center;"><img src="images/bottom.jpg" style="width: 969px; height: 107px;"></p>
        <p></p>
    </form>
</body>
</html>